let t = require;
let  e = module
let  o =  e.exports;
 o.default =  e.exports;

                'use strict';
                console.log("start"),
                    Object.defineProperty(o, '__esModule', {
                        value: !0
                    });
                var n = t('Logger'),
                    i = t('ApiUtils'),
                    r = (function() {
                        function t() {}
                        return (
                            (t.randomInt = function(t, e) {
                                if ((void 0 === e && (e = null), null != e)) {
                                    var o = e - t;
                                    return Math.round(t + Math.random() * o);
                                }
                                return Math.round(Math.random() * t);
                            }),
                            (t.randomFloat = function(t, e) {
                                if ((void 0 === e && (e = null), null != e)) {
                                    var o = e - t;
                                    return t + Math.random() * o;
                                }
                                return Math.random() * t;
                            }),
                            (t.randomAverage = function(e) {
                                return null == e || 0 == e.length ?
                                    null :
                                    e[t.randomInt(e.length - 1)];
                            }),
                            (t.weightsRandom = function(e) {
                                if (0 == e.length) return 0;
                                for (var o = 0, n = 0; n < e.length; n++) {
                                    o += e[n];
                                }
                                for (var i = 0, r = t.randomInt(o), a = 0; a < e.length;) {
                                    if (r <= (i += e[a])) return a;
                                    a += 1;
                                }
                                return 0;
                            }),
                            (t.shiffRand = function(t) {
                                return t.sort(function() {
                                    return Math.random() - 0.5;
                                });
                            }),
                            (t.getRandomList = function(t, e) {
                                if (0 == e) return [];
                                if (0 == t.length || t.length <= e) return t;
                                for (
                                    var o = [], n = t.slice(0, t.length), i = 0; i < e && n.length > 0;

                                ) {
                                    var r = this.randomInt(n.length - 1),
                                        a = n.splice(r, 1)[0];
                                    o.push(a), i++;
                                }
                                return o;
                            }),
                            (t.equalFloat = function(t, e) {
                                return Math.round(1e6 * t) == Math.round(1e6 * e);
                            }),
                            (t.getZIndex = function(e) {
                                return t.clamp(
                                    Math.ceil(e),
                                    cc.macro.MIN_ZINDEX,
                                    cc.macro.MAX_ZINDEX
                                );
                            }),
                            (t.to = function(t, e, o, n) {
                                var i = t + n * Math.cos(o),
                                    r = e + n * Math.sin(o);
                                return cc.v2(i, r);
                            }),
                            (t.calcAngle = function(e, o) {
                                var n = t.absAngle(e),
                                    i = t.absAngle(o);
                                return i - n > 180 ? n - i : i - n < -180 ? n - i : i - n;
                            }),
                            (t.calcIncludedAngle = function(e, o, n, i, r) {
                                var a = t.distance2(e, o, n, i),
                                    s = Math.atan2(e - n, o - i) - r * t.Deg2Rad,
                                    c = n + Math.sin(s) * a,
                                    l = i + Math.cos(s) * a,
                                    u = (180 * Math.atan2(c - n, l - i)) / Math.PI + r;
                                return Math.abs(t.absAngle(u) - t.absAngle(r));
                            }),
                            (t.absAngle = function(t) {
                                return (t + 360) % 360;
                            }),
                            (t.signAngle = function(t) {
                                return t > 180 ? t - 360 : t;
                            }),
                            (t.clamp = function(t, e, o) {
                                var n = t;
                                return t < e ? (n = e) : t > o && (n = o), n;
                            }),
                            (t.lerp = function(e, o, n) {
                                return e + (o - e) * t.clamp(n, 0, 1);
                            }),
                            (t.repeat = function(t, e) {
                                return t - Math.floor(t / e) * e;
                            }),
                            (t.squaredDistance2 = function(t, e, o, n) {
                                var i = t - o,
                                    r = e - n;
                                return i * i + r * r;
                            }),
                            (t.squaredDistance3 = function(t, e, o, n, i, r) {
                                var a = t - n,
                                    s = e - i,
                                    c = o - r;
                                return a * a + s * s + c * c;
                            }),
                            (t.distance2 = function(t, e, o, n) {
                                return Math.sqrt(Math.pow(t - o, 2) + Math.pow(e - n, 2));
                            }),
                            (t.distance3 = function(t, e, o, n, i, r) {
                                return Math.sqrt(
                                    Math.pow(t - n, 2) + Math.pow(e - i, 2) + Math.pow(o - r, 2)
                                );
                            }),
                            (t.splitInt = function(e, o) {
                                for (
                                    var n = new Array(o),
                                        i = Math.floor(e / o + 1),
                                        r = e - i * o,
                                        a = r / o,
                                        s = 0; s < o; s++
                                ) {
                                    var c = s < o - 1 ? t.randomInt(0, a) : r;
                                    (r -= c), (n[s] = i + c);
                                }
                                for (s = n.length - 1; s >= 0; s--) {
                                    if (n[s] <= 0)
                                        for (
                                            var l = Math.abs(n[s]) + 1, u = s - 1; u >= 0 && l > 0; u--, l--
                                        ) {
                                            n[s]++, n[u]--;
                                        }
                                }
                                return n;
                            }),
                            (t.splitInt2 = function(t, e, o) {
                                void 0 === o && (o = 1);
                                for (
                                    var n = new Array(e),
                                        i = Math.round(e + 2 * Math.max(0, Math.min(o, 1)) * e + 1),
                                        r = Math.floor(t / i),
                                        a = t - r * e,
                                        s = a / (((e - 1) * e) / 2),
                                        c = 0; c < e; c++
                                ) {
                                    var l = Math.max(1, Math.floor(c < e - 1 ? s * c : a));
                                    (a -= l), (n[c] = r + l);
                                }
                                return n;
                            }),
                            (t.convertColor = function(t, e) {
                                void 0 === e && (e = 255);
                                var o = (t >> 16) & 255,
                                    n = (t >> 8) & 255,
                                    i = 255 & t;
                                return new cc.Color(o, n, i, e);
                            }),
                            (t.segmentsIntr = function(t, e, o, i, r, a, s, c) {
                                var l, u;
                                return Math.abs(i - e) +
                                    Math.abs(o - t) +
                                    Math.abs(c - a) +
                                    Math.abs(s - r) ==
                                    0 ?
                                    (r - t + (a - e) == 0 ?
                                        n.Logger.log('ABCD是同一个点！') :
                                        n.Logger.log('AB是一个点，CD是一个点，且AC不同！'),
                                        null) :
                                    Math.abs(i - e) + Math.abs(o - t) == 0 ?
                                    ((t - s) * (a - c) - (e - c) * (r - s) == 0 ?
                                        n.Logger.log('A、B是一个点，且在CD线段上！') :
                                        n.Logger.log('A、B是一个点，且不在CD线段上！'),
                                        null) :
                                    Math.abs(c - a) + Math.abs(s - r) == 0 ?
                                    ((s - o) * (e - i) - (c - i) * (t - o) == 0 ?
                                        n.Logger.log('C、D是一个点，且在AB线段上！') :
                                        n.Logger.log('C、D是一个点，且不在AB线段上！'),
                                        null) :
                                    (i - e) * (r - s) - (o - t) * (a - c) == 0 ?
                                    (n.Logger.log('线段平行，无交点！'), null) :
                                    ((u =
                                            ((i - e) * (a - c) * (r - t) -
                                                a * (i - e) * (r - s) +
                                                e * (o - t) * (a - c)) /
                                            ((o - t) * (a - c) - (i - e) * (r - s))),
                                        ((l =
                                                ((o - t) * (r - s) * (a - e) -
                                                    r * (o - t) * (a - c) +
                                                    t * (i - e) * (r - s)) /
                                                ((i - e) * (r - s) - (o - t) * (a - c))) -
                                            t) *
                                        (l - o) <=
                                        0 &&
                                        (l - r) * (l - s) <= 0 &&
                                        (u - e) * (u - i) <= 0 &&
                                        (u - a) * (u - c) <= 0 ?
                                        (n.Logger.log('线段相交于点(' + l + ',' + u + ')！'), {
                                            x: l,
                                            y: u
                                        }) :
                                        (n.Logger.log(
                                                '线段相交于虚交点(' + l + ',' + u + ')！'
                                            ),
                                            null));
                            }),
                            (t.bezier2 = function(t, e) {
                                for (
                                    var o, n, r, a, s = [], c = [1, 1], l = t.length, u = 3; u < l + 1; u++
                                ) {
                                    for (var h = [], p = 0; p < c.length; p++) {
                                        h.push(c[p]);
                                    }
                                    (c[0] = 1), (c[u - 1] = 1);
                                    for (var f = 0; f < h.length - 1; f++) {
                                        c[f + 1] = h[f] + h[f + 1];
                                    }
                                }
                                for (p = 0; p <= e; p++) {
                                    var d = i.ApiUtils.v2(0, 0);
                                    for (n = p / e, u = 0; u < l; u++) {
                                        (r = l - 1 - u),
                                        (a = u),
                                        (o = c[u] * Math.pow(1 - n, r) * Math.pow(n, a)),
                                        (d.x += t[u].x * o),
                                        (d.y += t[u].y * o);
                                    }
                                    s.push(d);
                                }
                                return s;
                            }),
                            (t.bezier3 = function(t, e) {
                                for (
                                    var o, n, r, a, s = [], c = [1, 1], l = t.length, u = 3; u < l + 1; u++
                                ) {
                                    for (var h = [], p = 0; p < c.length; p++) {
                                        h.push(c[p]);
                                    }
                                    (c[0] = 1), (c[u - 1] = 1);
                                    for (var f = 0; f < h.length - 1; f++) {
                                        c[f + 1] = h[f] + h[f + 1];
                                    }
                                }
                                for (p = 0; p <= e; p++) {
                                    var d = i.ApiUtils.v3(0, 0, 0);
                                    for (n = p / e, u = 0; u < l; u++) {
                                        (r = l - 1 - u),
                                        (a = u),
                                        (o = c[u] * Math.pow(1 - n, r) * Math.pow(n, a)),
                                        (d.x += t[u].x * o),
                                        (d.y += t[u].y * o),
                                        (d.z += t[u].z * o);
                                    }
                                    s.push(d);
                                }
                                return s;
                            }),
                            (t.Rad2Deg = 180 / Math.PI),
                            (t.Deg2Rad = Math.PI / 180),
                            (t.MaxLongInt = Math.pow(2, 64)),
                            t
                        );
                    })();
                (o.default = r), console.log("end");
            module.exports =  e.exports;